package com.chrray.position.tasks;

import com.chrray.position.mapper.position.FdJobPostingsMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author liujianxin
 * @date 2024/09/26 18:10
 */
@Slf4j
@Component
@AllArgsConstructor
public class JobTasks {
    private final FdJobPostingsMapper mapper;

    /**
     * 每小时检查一次职位状态
     * 对已满一个月且正在匹配中的职位 变更为 进行中
     */
    @Scheduled(cron = "0 0 * * * ?")
    //@Scheduled(cron = "*/5 * * * * ?")
    public void checkUpdateJobState() {
        int cnt = mapper.checkUpdateJobState();
        log.info("[职位状态] 变更超期职位状态: {}", cnt);
    }
}
